﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.payment {
    import net.wooga.pets.events.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class PlaceOrderFailureCommand extends Command {

        public var event:InfoEvent;

        override public function execute():void{
            var _local1:Array = (this.event.info as Array);
            var _local2:Object = _local1.shift();
            var _local3 = "payment_errormassage_title";
            var _local4 = "payment_errormessage_text";
            switch (_local2.product_type){
                case ProtocolConstants.BUY_GEMS:
                case ProtocolConstants.BUY_BOOSTS:
                    _local3 = (("payment_" + _local2.product_type) + "_failed_title");
                    _local4 = (("payment_" + _local2.product_type) + "_failed_text");
                    break;
            };
            this.showFailedPopup(_local3, _local4, _local2);
        }
        private function showFailedPopup(_arg1:String, _arg2:String, _arg3:Object):void{
            var _local4:Object = {title:_arg1, text:_arg2, product_id:_arg3.product_id, product_type:_arg3.product_type, icon:_arg3.icon};
            var _local5:InfoEvent = new InfoEvent(EventConstants.CREATE_POPUP, GameConstants.PAYMENT_FAILED_POPUP, _local4);
            dispatch(_local5);
        }

    }
}//package net.wooga.pets.controllers.payment 
